package com.qianyu.project.mapper;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.qianyu.project.entity.IncomeContract;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.qianyu.project.mapper.provider.sy.IncomeContractProvider;
import com.qianyu.project.vo.IncomeContractVo;
import com.qianyu.project.vo.IncomeReportVo;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.SelectProvider;
import org.springframework.stereotype.Repository;

import java.util.Map;

/**
 * <p>
 * 收入合同 Mapper 接口
 * </p>
 *
 * @author gs
 * @since 2021-01-30
 */
@Repository
public interface IncomeContractMapper extends BaseMapper<IncomeContract> {

    @Select("select max(id) from income_contract where year(create_date)=year(curdate())")
    String getMaxId();

    @SelectProvider(type = IncomeContractProvider.class, method = "selectPageData")
    IPage<IncomeContractVo> selectPageData(IPage iPage, Map<String, String> params);

    @SelectProvider(type = IncomeContractProvider.class, method = "getOne")
    IncomeContractVo getOne(String id);

    @SelectProvider(type = IncomeContractProvider.class, method = "selectByPid")
    IncomeContractVo selectByPid(String id);

    @SelectProvider(type = IncomeContractProvider.class, method = "selectInfo")
    IPage<IncomeContractVo> selectInfo(IPage page, Map<String, String> params);

    @SelectProvider(type = IncomeContractProvider.class, method = "selectReport")
    IPage<IncomeReportVo> selectReport(IPage page, Map<String, String> params);
}
